package com.hlw.hr_man.serviceImpl;

import java.util.List;

import com.hlw.hr_man.Model.AskForLeave;
import com.hlw.hr_man.dao.AskForLeaveDao;
import com.hlw.hr_man.daoImpl.AskForLeaveDaoImpl;
import com.hlw.hr_man.service.AskForLeaveService;

/**
 * 
 * @ClassName: AskForLeaveServiceImpl
 * @Description: 请假服务实现类
 * @author 唐明
 * @date 2016年9月13日 下午4:05:56
 *
 */
public class AskForLeaveServiceImpl implements AskForLeaveService {
	
	AskForLeaveDao afldao = new AskForLeaveDaoImpl();

	@Override
	public List<AskForLeave> getEmployeeAflByEid(int eid, int start, int pageSize) {
		// TODO Auto-generated method stub
		return afldao.selectEmployeeAflByEid(eid, start, pageSize);
	}

	@Override
	public int getEmployeeAfl(int eid) {
		// TODO Auto-generated method stub
		return afldao.selectEmployeeAfl(eid);
	}

	@Override
	public List<AskForLeave> getEmployeeAflBySearch(String searchType, String searchContent, int start, int pageSize) {
		// TODO Auto-generated method stub
		return afldao.selectEmployeeAflBySearch(searchType, searchContent, start, pageSize);
	}

	@Override
	public int getEmployeeAflCount(String searchType, String searchContent) {
		// TODO Auto-generated method stub
		return afldao.selectEmployeeAflCount(searchType, searchContent);
	}

	@Override
	public boolean addAfl(AskForLeave afl) {
		// TODO Auto-generated method stub
		if (afldao.insertAfl(afl) == 1) {
			return true;
		} else {
			return false;
		}
	}

	@Override
	public int updateAfl(int afl_id) {
		// TODO Auto-generated method stub
		return afldao.updateAfl(afl_id);
	}

	@Override
	public boolean deleteAflByEid(int e_id) {
		// TODO Auto-generated method stub
		if (afldao.deleteAflByEid(e_id)>=0) {
			return true;
		} else {
			return false;
		}
	}

	@Override
	public List<AskForLeave> getApplyAfl(int start, int pageSize) {
		// TODO Auto-generated method stub
		return afldao.selectApplyAfl(start, pageSize);
	}

	@Override
	public int getApplyAflCount() {
		// TODO Auto-generated method stub
		return afldao.selectApplyAflCount();
	}

	@Override
	public int agreeAflApplyByAskId(int ask_id) {
		// TODO Auto-generated method stub
		return afldao.agreeAflApplyByAskId(ask_id);
	}

	@Override
	public List<AskForLeave> getAflApplyBySearch(String searchType, String searchContent, int start, int pageSize) {
		// TODO Auto-generated method stub
		return afldao.selectAflApplyBySearch(searchType, searchContent, start, pageSize);
	}

	@Override
	public int getApplyAflCount(String searchType, String searchContent) {
		// TODO Auto-generated method stub
		return afldao.selectApplyAflCount(searchType, searchContent);
	}

}
